import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.GridLayout;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Vector;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;


public class reserves extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					reserves frame = new reserves();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public reserves(String seient) {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 311, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new GridLayout(0, 2, 0, 0));
		
		JLabel lblNom = new JLabel("NOM");
		contentPane.add(lblNom);
		
		textField = new JTextField();
		contentPane.add(textField);
		textField.setColumns(10);
		
		JLabel lblCognoms = new JLabel("Cognoms");
		contentPane.add(lblCognoms);
		
		textField_1 = new JTextField();
		contentPane.add(textField_1);
		textField_1.setColumns(10);
		
		JLabel lblResident = new JLabel("Resident");
		contentPane.add(lblResident);
		Vector<String>cb=new Vector<String>();
		cb.add("S");
		cb.add("N");
		JComboBox<String> comboBox = new JComboBox<String>(cb);
		contentPane.add(comboBox);
		
		JLabel lblNewLabel = new JLabel("Data reserva");
		contentPane.add(lblNewLabel);

		
		Calendar c2 = new GregorianCalendar();
		String d= c2.get(Calendar.DATE)+"/"+c2.get(Calendar.MONTH)+"/"+c2.get(Calendar.YEAR);
		
		textField_2 = new JTextField();
		textField_2.setText(d);
		textField_3.setEditable(false);
		contentPane.add(textField_2);
		textField_2.setColumns(10);
		
		JLabel lblSeient = new JLabel("Seient");
		contentPane.add(lblSeient);
		
		textField_3 = new JTextField(seient);
		textField_3.setEditable(false);
		contentPane.add(textField_3);
		textField_3.setColumns(10);
		
		JButton btnRegistrar = new JButton("Registrar");
		btnRegistrar.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				if(textField_2.getText()=="" || textField.getText()==""){
					
				} else {
					
				}
			}
		});
		contentPane.add(btnRegistrar);
		
		JButton btnCancelar = new JButton("Cancelar");
		contentPane.add(btnCancelar);
		
		
	}

}
